﻿# encoding:utf-8

def ifTest():
    s1 = '你好'
    s2 = ''
    s3 = None

    if s1:
        print('1111111111')
    if s2:
        print('2222222222')
    if s3:
        print('333333333')

    print('--------')
    print(len(s1))
    print('--------')
    print(len(s2))
    print('--------')
    # print(len(s3)) 这里会报错

# 单字符替换
def translateTest():
    intab = "aeiou"
    outtab = "12345"
    trantab = str.maketrans(intab, outtab)
    
    ss = "this is string example....wow!!!"
    print(ss.translate(trantab))

def replaceTest():
    ss = "this is string example....wow!!!"
    s2 = ss.replace('this','THIS')
    print(ss)
    print(s2)

# 判断字符串是否为空
def main():
    # ifTest()
    replaceTest()
    

if __name__ == '__main__':
    main()